package boogui.movie;

import java.awt.Image;
import java.awt.image.BufferedImage;
import java.util.Scanner;

import javax.swing.ImageIcon;
import javax.swing.JLabel;

public class MovieService implements IMovieService {

	IMovieDAO mvdao = null;

	public MovieService() {
		mvdao = new MovieDAO();
	}

	@Override
	public void searchmovie(MovieVO m) {
		mvdao.selectMovie(m);
	}

	@Override
	public void readPosterImage(String title, JLabel lbl, int width, int height) {
		BufferedImage image = null;
		image = mvdao.readImage(title);
		Image resizeimg = image.getScaledInstance(width, height, Image.SCALE_SMOOTH);
		lbl.setIcon(new ImageIcon(resizeimg));
	}
	
}